package terminal.network;


public class Connector implements Runnable {
	private int port;
	private String host;
	private ConnectionT cm = null;
	private StanT stanT = null;
	
	public Connector(int port, String host, ConnectionT cm, StanT stanT){
		this.port = port;
		this.host = host;
		this.cm = cm;
		this.stanT = stanT;
	}
	

	public void run() {
		boolean notcon = true;
		while(notcon){
			try {
				cm.connect(port, host);
				notcon = false;
			} catch (Exception e) {
			}
			
			try {
				Thread.sleep(500);
			} catch (InterruptedException e1) {
				e1.printStackTrace();
			}
			
			
			System.out.println("dojpa laczeniowa");
		}	
		
		/*	
		boolean notdane = !stanK.isOdebraneDane();
		while(notdane){
			try {
				Thread.sleep(8000);
			} catch (InterruptedException e1) {
				e1.printStackTrace();
			}
			notdane = !stanK.isOdebraneDane();
			System.out.println(stanK.isOdebraneDane());
			try {
				cm.getData();
			} catch (Exception e) {

			}
			System.out.println("dojpa prosbowa");
		}	
		*/
		
	}	
}